<?php

class Home extends CI_Controller {

    public function view() {
        $this->load->model('dao/ProductDAO');
        $title = 'ndh';
        $this->load->library('parser');
        $this->load->helper('url');
        $data = array('blog_heading' => 'it is blog', 'content' => 'longstorey', 'title' => 'ndh');
        $proHelper = new ProductDAO();
        $data['latesProduct'] = $proHelper->readAll();
//        $data['latesProduct'] = array("a"=>"a","b"=>b);
        $this->parser->parse('templates/header', $data);

        $this->load->view('home/index.php', $data);
        $this->load->view('templates/footer');
    }

    public function detailProduct($id) {
        $this->load->model('dao/ProductDAO');
        $proHelper = new ProductDAO();
        $currPro = $proHelper->reaByID($id);
        $data['currPro'] = $currPro;
        //$data['primaryImage'] = $proHelper->getImages( $currPro["ProductID"])['ImageURL'];
        $this->load->view('templates/header', $data);
        $this->load->view('product/detail.php');
        $this->load->view('templates/footer');
    }

}
